/**
* Copyright (C) 2018-2020
* All rights reserved, Designed By www.gzchengguo.cn
* 注意：
* 本软件为www.gzchengguo.cn开发研制，未经购买不得商用
* 购买后可获得全部源代码（禁止转卖、分享、上传到码云、github等开源平台）
* 一经发现盗用、分享等行为，将追究法律责任，后果自负
*/
package link.chengguo.orangemall.modules.product.service.mapper;


import link.chengguo.orangemall.common.mapper.CoreMapper;
import link.chengguo.orangemall.modules.product.domain.OrangeStoreProductRelation;
import link.chengguo.orangemall.modules.product.vo.OrangeStoreProductRelationQueryVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 商品点赞和收藏表 Mapper 接口
 * </p>
 *
 * @author chengguo
 * @since 2019-10-23
 */
@Repository
public interface OrangeStoreProductRelationMapper extends CoreMapper<OrangeStoreProductRelation> {

    @Select("select B.id pid,A.category,B.store_name as storeName,B.price," +
            "B.ot_price as otPrice,B.sales,B.image,B.is_show as isShow" +
            " from orange_store_product_relation A left join orange_store_product B " +
            "on A.product_id = B.id where A.uid=#{uid} and A.is_del = 0 and B.is_del = 0")
    List<OrangeStoreProductRelationQueryVo> selectList(Page page, @Param("uid") Long uid);


}
